package com.nuoniu.sibanyun.entity.cm;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p>
 * 合同标的
 * </p>
 *
 * @author 小啊刚
 * @since 2021-10-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("cm_contract_subject")
@ApiModel(value="CmContractSubject对象", description="合同标的")
public class CmContractSubject extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "合同id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "租户id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "产品名称")
    @TableField("no")
    private String no;

    @ApiModelProperty(value = "物料id")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "物料名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "商品属性")
    @TableField("commodity_attribute")
    private String commodityAttribute;

    @ApiModelProperty(value = "主计量id")
    @TableField("base_unit")
    private Integer baseUnit;

    @ApiModelProperty(value = "主计量名称")
    @TableField("base_unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "单计量id")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位组ID")
    @TableField("unit_group_id")
    private Integer unitGroupId;

    @ApiModelProperty(value = "数量")
    @TableField("base_quantity")
    private BigDecimal baseQuantity;

    @ApiModelProperty(value = "辅计量")
    @TableField("sub_unit")
    private Integer subUnit;

    @ApiModelProperty(value = "辅计量名称")
    @TableField("sub_unit_name")
    private String subUnitName;

    @ApiModelProperty(value = "辅计量数量")
    @TableField("sub_quantity")
    private BigDecimal subQuantity;

    @ApiModelProperty(value = "换算率")
    @TableField("unit_exchange_rate")
    private BigDecimal unitExchangeRate;

    @ApiModelProperty(value = "单价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "含税单价")
    @TableField("include_tax_price")
    private BigDecimal includeTaxPrice;

    @ApiModelProperty(value = "金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "税额")
    @TableField("tax_amount")
    private BigDecimal taxAmount;

    @ApiModelProperty(value = "税率")
    @TableField("tax_rate")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "价税合计")
    @TableField("price_tax_total")
    private BigDecimal priceTaxTotal;

    @ApiModelProperty(value = "折扣率")
    @TableField("discount_rate")
    private BigDecimal discountRate;

    @ApiModelProperty(value = "交货日期")
    @TableField("delivery_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate deliveryDate;

    @ApiModelProperty(value = "交货地址")
    @TableField("delivery_address")
    private String deliveryAddress;

    @ApiModelProperty(value = "是否赠品")
    @TableField("is_gift")
    private Boolean isGift;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "变更id")
    @TableField("change_id")
    private Integer changeId;
}
